function show_title_deal(deal_id) {
	$('#d_' + deal_id).find('div[name=title]').show();
}

function hide_title_deal(deal_id) {
	$('#d_' + deal_id).find('div[name=title]').hide();
}

function ajax_get_more_deals(page, item_per_page) {
	var category_id = $('#category_id').val();
	if (category_id == '') category_id = -1;
    $.blockUI();
    var url = '/deal/all_deals/' + category_id + '/ajax';
    if ($('#desc').val() != '')
        url += '/'+$('#desc').val();
        
	$.post(url, {
		'page': page,
		'item_per_page': item_per_page,
	}, function(content) {
        $.unblockUI();
		$('#ajax_paging').remove();
		$('#deals').append(content);
	})
}

function calPercent($value_100_percent, $value)
{
    //100% -> $value_100_percent;
    //?% -> $value
    return $value * 100 / $value_100_percent;
}